package cn.diancan.service;

import java.util.List;

import cn.diancan.dto.PurchaseSaleOrderStatisticsDto;
import cn.diancan.dto.PurchaseSaleOrderByTypeDto;
import cn.diancan.dto.query.PurchaseSaleOrderProductQuery;
import cn.diancan.exception.OutMsgException;
import cn.diancan.model.PurchaseSaleOrder;
import cn.diancan.model.PurchaseSaleOrderProduct;
import cn.diancan.vo.PurchaseSaleOrderCountVo;
import cn.diancan.vo.SaleOrderCarVo;
import cn.diancan.vo.SaleProductCarVo;
import cn.diancan.vo.model.PurchaseSaleOrderProductVo;
import cn.diancan.vo.model.PurchaseSaleOrderVo;
import cn.diancan.vo.other.Pager;

public interface PurchaseSaleOrderService {
    
    
    public PurchaseSaleOrder saveCreatePurchaseOrder( List<PurchaseSaleOrderProductVo> productVoList, String outOrderNumber, String orderMark,String ip) throws OutMsgException, Exception;
    
    
    public PurchaseSaleOrder saveCreateSaleOrder(List<PurchaseSaleOrderProductVo> productVoList,String outOrderNumber, Integer outRealTotalQuantity,Double outRealTotalPrice,String orderMark,Integer moneyFloatDigit,  String clientCreateTime,Long shopClerkId, Integer payType,String ip) throws OutMsgException,Exception ;
    
    /**
     * 
     * @param purchaseOrderId
     * @param goodsId
     * @param productId
     * @return
     * @throws OutMsgException
     */
    public PurchaseSaleOrderProduct findPurchaseOrderProduct(Long purchaseOrderId,Long goodsId,Long productId)throws OutMsgException;
    

    
    public Pager findPagerBySaleOrderProduct(Pager pager,PurchaseSaleOrderProductQuery query,PurchaseSaleOrderStatisticsDto statisticsDto )throws OutMsgException,Exception;


    public Pager findPagerBySaleOrder(Pager pager,PurchaseSaleOrderProductQuery query,PurchaseSaleOrderStatisticsDto statisticsDto )throws OutMsgException,Exception;
    
    
    
    public List<PurchaseSaleOrder> findPurchaseSaleOrderList(Integer pageNo,Integer row);
    
    
    public List<PurchaseSaleOrderProduct> findPurchaseSaleOrderProduct(Long purchaseSaleOrderId, Integer pageNo,Integer row);


    /**
     * 上传单个 产品，及订单信息
     * @param purchaseSaleOrderVo
     * @param productCarVo
     * @return
     * @throws OutMsgException
     * @throws Exception
     */
    public SaleOrderCarVo updatePurchaseSaleProduct(PurchaseSaleOrderVo purchaseSaleOrderVo, SaleProductCarVo productCarVo)throws OutMsgException,Exception;

    /**
     * 查询订单信息
     * @param orderNumber
     * @param checkOrderStatus
     * @return
     * @throws OutMsgException
     * @throws Exception
     */
    public SaleOrderCarVo findSinglePurchaseSaleOrder(String orderNumber, boolean checkOrderStatus)throws OutMsgException,Exception;


    /**
     * 移动桌位
     * @return
     * @throws OutMsgException
     * @throws Exception
     */
    public boolean updateMoveMealLoaction(String outOrderNumber, Long mealLocationId)throws OutMsgException,Exception;

    /**
     * 结算
     * @param outOrderNumber
     * @param payType
     * @return
     * @throws OutMsgException
     * @throws Exception
     */
    public boolean updatePayOrder(String outOrderNumber, Integer payType)throws OutMsgException,Exception;



    public boolean updateCancelOrder(String outOrderNumber)throws OutMsgException,Exception;


    public SaleOrderCarVo updateDiscount(String outOrderNumber,Integer discountType, Float discount,Double discountPrice)throws OutMsgException,Exception;


    public List<PurchaseSaleOrder> findOutSendOrderList(Long mealLocationId) throws OutMsgException,Exception;



    public PurchaseSaleOrderCountVo findCount( )throws OutMsgException,Exception;


    public PurchaseSaleOrderCountVo findOutMealCount(Long mealLocationId)throws OutMsgException,Exception;


    public List<PurchaseSaleOrderByTypeDto> findStByOrderCategory(PurchaseSaleOrderProductQuery query);



    public List<PurchaseSaleOrderByTypeDto> findStByPayType(PurchaseSaleOrderProductQuery query);


    public  PurchaseSaleOrderStatisticsDto findStatistics(PurchaseSaleOrderProductQuery query, PurchaseSaleOrderStatisticsDto statisticsDto);
}
